package com.cll.pmis.service.impl;

import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.cll.pmis.common.PageInfo;
import com.cll.pmis.entity.Drug;
import com.cll.pmis.mapper.DrugMapper;
import com.cll.pmis.service.IDrugService;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author chenliangliang
 * @since 2018-06-18
 */
@Service
public class DrugServiceImpl extends ServiceImpl<DrugMapper, Drug> implements IDrugService {

    @Override
    public DrugMapper getMapper() {
        return this.baseMapper;
    }

    @Override
    public PageInfo<Map<String, Object>> getDrugTakeInfo(Integer pageIndex, Integer pageSize, String time, String username, String phone,Integer dossierId, Integer status) {
        Page<Map<String,Object>> page=new Page<>(pageIndex,pageSize);
        List<Map<String, Object>> mapList = this.baseMapper.queryDrugTakeByPage(time, username, phone, dossierId, status, page);
        page.setRecords(mapList);
        return new PageInfo<>(page);
    }
}
